package CollectionsDay01;

import java.util.ArrayList;
import java.util.Collection;

public class CollectionDemo3 {
    public static void main(String[] args) {
        Collection c = new ArrayList();
        Point p = new Point(1,2);
        c.add(p);//将p添加到c中
        System.out.println("p:"+p);
        System.out.println("c:"+c);

        p.setX(100);//修改x的值
        System.out.println("p:"+p);//(100,2)
        System.out.println("c:"+c);//[100,2]
    }
}
